using System.Windows;
using System.Windows.Documents;

namespace Supremacy.Client.Controls
{
    internal class NonLogicalAdornerDecorator : AdornerDecorator
    {
        public override UIElement Child
        {
            get
            {
                return base.Child;
            }
            set
            {
                if (base.Child == value)
                    return;

                base.RemoveVisualChild(base.Child);
                base.RemoveVisualChild(base.AdornerLayer);

                base.Child = value;

                if (value != null)
                {
                    base.AddVisualChild(value);
                    base.AddVisualChild(base.AdornerLayer);
                }

                base.InvalidateMeasure();
            }
        }
    }
}